{include file="public/header" /}
{load href="__PLUGINS__bootstrap/bootstrap-table.min.css"}
{load href="__PLUGINS__bootstrap/bootstrap-table.min.js"}
<style type="text/css">
#des,#des input{ width: 40px;text-align:center;}
#id{ width: 78px; }
.bs-checkbox{ width: 36px; height: 40px }
.fixed-table-toolbar .columns,.fixed-table-toolbar .search{margin-left:0px; margin-top: 0px }
#title span{ float: right; }
.asdlkjasd{ background: #1ab394; color: #fff}
</style>
 <body class="gray-bg">
 <div class="wrapper wrapper-content {:config('adminClass.main')}">
    <div class="ibox float-e-margins">
        {include file="public/tophead"}
        {include file="public/top" /}
        <div class="ibox-content">
        {include file="public/topsection"}
            <div class="row row-lg">
                <div class="col-sm-12">
                    <div class="example">
                        <form class="form-horizontal" method="post">
                        <table data-toggle="table">
                            <thead>
                                <tr>
                                    <th data-align="center">ID</th>
                                    <th data-align="center">文件</th>
                                    <th data-align="center">类型</th>
                                    <th data-align="center">真人</th>
                                    <th data-align="center">人脸认证</th>
                                    <th data-align="center">时间</th>
                                    <th data-align="center">管理</th>
                                </tr>
                            </thead> 
                            <tbody id="form">
                                {volist name="data" id="v"}
                                <tr id="id{$v.id}" class="class">
                                    <td>{$v.id}</td>
                                    <td>{eq name='$v.types' value='1'}
                                        <a href="__ROOT__{:json_decode($v.pic,true)[0]}" title="{$v.id}" target="_blank">
                                            <img style="width:200px !important;" src="__ROOT__{:json_decode($v.pic,true)[0]}" />
                                        </a>
                                        {else /}
                                        <video src="__ROOT__{:json_decode($v.pic,true)[0]}" volume="0.5" controls preload="true" playsinline webkit-playsinline="webkit-playsinline" x-webkit-airplay="allow" style="height:50% !important;width:auto !important">您的浏览器不支持播放本视频</video>
                                        {/eq}
                                    </td>
                                    <td>{if condition="$v.is_face == 1"}真人{else /}普通{/if}</td>
                                    <td id="real{$v.id}">
                                        {if condition="$v.is_face == 1"}
                                        <span class="btn btn-xs btn-danger" onclick="setRealFace('{$v.id}', 0)">取消真人</span>
                                        {else /}
                                        <span class="btn btn-xs btn-primary" onclick="setRealFace('{$v.id}', 1)">设置真人</span>
                                        {/if}</td>
                                    <td>
                                        {if condition="$v.is_auth == 1"}
                                        <span class="btn btn-xs btn-danger">是</span>
                                        {else /}
                                        <span class="btn btn-xs btn-primary">否</span>
                                        {/if}</td>
                                    <td>{$v.time}</td>
                                    <td>
                                        <div class="btn-group">
                                            <div data-toggle="dropdown" class="btn btn-primary btn-xs dropdown-toggle">操作 <span class="caret"></span>
                                            </div>
                                            <ul class="dropdown-menu">
                                                <li><a onClick="del({$v.id})">删除</a>
                                                </li>
                                            </ul>
                                        </div>
                                    </td>
                                </tr>
                                {/volist}
                            </tbody>
                        </table>
                        </form>
                    </div>
                </div>  
            </div>
            <hr>
            <div class="row row-lg">
                <div class="col-sm-12 pages">{$page}</div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}






<script type="text/javascript">
function del(id){
    swal_del(id,"{:url('imgdel')}")
}
    function setRealFace(id, state) {
        $.ajax({
            type: 'post',
            url: '{:url("setRealFace")}',
            data: {id, state},
            dataType: 'json',
            success:function(ret){
                if (ret.ret) {
                    let html = state ? `<span class="btn btn-xs btn-danger" onclick="setRealFace('${id}', 0)">取消真人</span>` : `<span class="btn btn-xs btn-primary" onclick="setRealFace('${id}', 1)">设置真人</span>`;
                    $('#real' + id).html(html)
                    layer.msg(ret.ret);
                } else {
                    layer.msg(ret.err);
                }

            },
            error:function(err){
                layer.msg(err)
            }
        });
    }
</script>
 